#ifndef _TEMPLATE_H
#define _TEMPLATE_H

#include <iostream>
#include <cstring>

class TextChar
{
public:
	TextChar()
    {
       // value_.reserve(fieldWidth + 1);
    }
    void read(FILE* is)
    {
        char field[fieldWidth + 1];

        field[fieldWidth] = '\0';
        fgets(field, fieldWidth + 1, is);
        strcpy(value_, field);
    }
    void read(std::istream& is)
    {
        char field[fieldWidth + 1];

        field[fieldWidth] = '\0';
        is.get(field, fieldWidth + 1);
        strcpy(value_, field);
    }
    const char* getValue() const
    {
        return value_;
    }
protected:
	static const int fieldWidth=15;
    char value_[fieldWidth + 1];
};

class TextString
{
public:
    TextString()
    {
        value_.reserve(fieldWidth + 1);
    }
    void read(FILE* is)
    {
        char field[fieldWidth + 1];

        field[fieldWidth] = '\0';
        fgets(field, fieldWidth + 1, is);
        value_.assign(field);
    }
    void read(std::istream& is)
    {
        char field[fieldWidth + 1];

        field[fieldWidth] = '\0';
        is.get(field, fieldWidth + 1);
        value_.assign(field);
    }
    const char* getValue() const
    {
        return value_.c_str();
    }
protected:
	static const int fieldWidth=15;
    std::string value_;
};


#endif